<?php
/**
 * Created by PhpStorm.
 * User: best_jobs_liu
 * Date: 17-5-7
 * Time: 下午7:07
 */

namespace Home\Service;
class UserService extends BaseService {

    protected $model;
    function __construct($name = '', $tablePrefix = '', $connection = '')
    {
        parent::__construct($name, $tablePrefix, $connection);
        $this->model = D('User');
    }


    public function getOneById($id){

        $select = $this->model->where('id=' . $id)->find();
        return $select;
    }

    public function count($id){
        $count      = $this->model->count();// 查询满足要求的总记录数
        return $count;
    }

}